using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using System.Collections;
using System.Collections.Specialized;

namespace UMC.Web
{
    /// <summary>
    /// 日期段对话框
    /// </summary>
    public class UIDateSheetDialog : UIDialog
    {
        public UIDateSheetDialog(string startDate, String endDate)
        {
            this.DefaultValue = $"{startDate},{endDate}";
        }
        public UIDateSheetDialog(string startDate)
        {
            this.DefaultValue = startDate;
            this.IsSingleDate = true;
        }
        public UIDateSheetDialog()
        {

        }

        /// <summary>
        /// 对话框类型
        /// </summary>
        protected override string DialogType
        {
            get { return "DateSheet"; }
        }
        /// <summary>
        /// 开始日期标题
        /// </summary>
        public string SingleTitle
        {

            get
            {
                return this.Config["StartTitle"];
            }
            set
            {

                this.Config.Put("StartTitle", value);

            }
        }
        public string StartTitle
        {

            get
            {
                return this.Config["StartTitle"];
            }
            set
            {

                this.Config.Put("StartTitle", value);

            }
        }
        public string EndTitle
        {
            get
            {
                return this.Config["EndTitle"];
            }
            set
            {

                this.Config.Put("EndTitle", value);

            }
        }
        public bool IsSingleDate
        {

            get
            {
                return this.Config.ContainsKey("IsSingleDate");
            }
            set
            {
                if (value)
                {
                    this.Config.Put("IsSinleDate", true);
                }
                else
                {

                    this.Config.Remove("IsSinleDate");
                }
            }
        }
    }
}
